package com.cn.kabalifeuser.ui.integral.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.ui.integral.bean.ShoppingMalListBean;
import com.cn.kabalifeuser.utils.GlideUtil;

import java.time.chrono.HijrahEra;
import java.util.List;

/**
 * Created by 晓林 on 2020/9/10.
 * function:
 */
public class ShoppingMallAdapter extends BaseQuickAdapter<ShoppingMalListBean.ResultBean.DataBean, BaseViewHolder> {

    int sign; //1 是正常 2是从互动专区的

    public ShoppingMallAdapter(int layoutResId, @Nullable List<ShoppingMalListBean.ResultBean.DataBean> data, int sign) {
        super(layoutResId, data);
        this.sign = sign;
    }

    @Override
    protected void convert(BaseViewHolder helper, final ShoppingMalListBean.ResultBean.DataBean item) {
        GlideUtil.ImageLoad(this.mContext, item.getImg(), helper.getView(R.id.img));
        helper.setText(R.id.title, item.getTitle())
                .setText(R.id.low_money, sign == 1 ? item.getLow_money() : item.getMoney())
                .setText(R.id.num, String.valueOf(item.getBuy_num()));


    }
}
